#include<conio.h>
#include<stdio.h>
#include<math.h>
#define MAX 100
 
int nhapmang(int a[], int n){
	printf("moi nhap mang vao theo thu tu tang dan:");
	printf("\n \t a[0]= ");
	scanf("%d",&a[0]);	
		int i=1;
	do{
		printf("\n\t a[%d]= ",i);
		scanf("%d",&a[i]);
		if(a[i-1]>a[i]){
			printf("Yeu cau nhap lai !\n");
			i--;
		}
		i++;
	}
	while(i<n);
}
void xuatmang(int a[], int n){
	printf("\n\nmang vua nhap vao: ");
	for(int i=0;i<n;i++){
		printf("\t%d",a[i]);
	}
}
main(){
	int a[MAX],n;
	printf("nhap so phan tu cua mang: ");
	scanf("%d",&n);
	nhapmang(a,n);
	xuatmang(a,n);
	getch();
}
